import java.util.Random;
import java.util.Scanner;

public class Demo03 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        Random ran = new Random();
        int[] arr = new int[10];
        for (int i = 0; i < arr.length; i++) {
            arr[i] = ran.nextInt(100);
        }
        for (int i = 0; i < arr.length; i++) {
            System.out.print(arr[i] + "  ");
        }
        System.out.println("\n======================");
        int Max = 0;
        for (int i = 0; i < arr.length; i++) {
            Max = arr[i] > Max ? arr[i] : Max;
        }
        System.out.print(Max + "   ");
        int MaxIndex = 0;
        for (int i = 1; i < arr.length; i++) {
            if (arr[i] > arr[MaxIndex])
                MaxIndex = i;
        }
        System.out.printf("最大值在数组第%d位",MaxIndex+1);
    }

}
